package pl.enigmatic.test;

import java.awt.event.ActionListener;

import javax.swing.JButton;

public class Button extends JButton {

	/** */
	private static final long serialVersionUID = 1L;

	private final int index;

	public Button(final ActionListener l, final String text, final int index) {
		super(text);
		addActionListener(l);
		this.index = index;
	}

	public Button(final Action action, final int index) {
		this(action, action.getText(), index);
	}

	public int getIndex() {
		return index;
	}
}